package cn.rongdao.jrkabao.model.cashadvance;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/11/6
 */

public class BindPayGetValidateCodeModel extends BaseKaMaoModel {

    public static BindPayGetValidateCodeModel getInstance() {
        return getPresent(BindPayGetValidateCodeModel.class);
    }

    public void execute(boolean isJiFen,String orderNum, String bindId, Observer<String> observer) {
        addParamStrings("is_jifen", isJiFen ? "1" : "0");
        addParamStrings("order_no", FRString.valueOf(orderNum));
        addParamStrings("bind_id", FRString.valueOf(bindId));
        Observable<String> observable = mServletApi.bindPayGetValidateCode(mParams).map(new HttpFunction<String>());
        toSubscribe(observable, observer);
    }

}